package com.zl.learning.swing;

import org.junit.Test;

import javax.swing.*;
import java.awt.*;

public class TestSwing {
    static {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
            e.printStackTrace();
        }
    }

    @Test
    public void test1() {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension dimension = toolkit.getScreenSize();
        System.out.println(dimension);
    }

    @Test
    public void test2(){
        int n = JOptionPane.showConfirmDialog(null, "你会了吗？", "标题党", JOptionPane.YES_NO_OPTION);
        System.out.println(n);
    }

    @Test
    public void test3(){
        JOptionPane.showMessageDialog(null,"Hello");
    }

    @Test
    public void test4(){
        String v = JOptionPane.showInputDialog(null,"请输入：\n","title",JOptionPane.PLAIN_MESSAGE);
        System.out.println(v);
    }
}
